﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsCategoryOrder.ascx.cs" Inherits="Controls_BackEnd_NewsCategoryOrder" %>
<%@ Register Assembly="ASTreeView" Namespace="Geekees.Common.Controls" TagPrefix="cc1" %>
<%@ Import Namespace="Business" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <!-- start content-outer -->
        <div id="content-outer">
            <!-- start content -->
            <div id="content">
                <div id="page-heading">
                    <h1>
                        <%=Resources.Resource.NewsCategoryOrder%></h1>
                </div>
                <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
                    <tr>
                        <th rowspan="3" class="sized">
                            <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowleft.jpg"
                                width="20" height="300" alt="" />
                        </th>
                        <th class="topleft">
                        </th>
                        <td id="tbl-border-top">
                            &nbsp;
                        </td>
                        <th class="topright">
                        </th>
                        <th rowspan="3" class="sized">
                            <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowright.jpg"
                                width="20" height="300" alt="" />
                        </th>
                    </tr>
                    <tr>
                        <td id="tbl-border-left">
                        </td>
                        <td style="vertical-align: top;">
                            <!--  start content-table-inner -->
                            <div id="content-table-inner">
                                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                    <tr valign="top">
                                        <td>
                                            <asp:Button ID="btnSave" OnClientClick="if(!CheckNull())return false;" class="form-submit"
                                                OnClick="AllCommand" runat="server" />
                                            &nbsp;<asp:Button Style="margin-left: 5px;" ID="btnBack" class="form-reset" OnClick="AllCommand"
                                                Text="Back" runat="server" />
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <td>
                                            <fieldset>
                                                <legend><strong> <%=Resources.Resource.NewsCategoryList %></strong></legend>
                                                <cc1:ASTreeView ID="astvMyTree" runat="server" BasePath="~/Resources/JS/treeview/astreeview/"
                                                    DataTableRootNodeValue="0" EnableRoot="false" EnableNodeSelection="true" EnableCheckbox="false"
                                                    EnableDragDrop="true" EnableTreeLines="true" EnableNodeIcon="true" EnableCustomizedNodeIcon="false"
                                                    AutoPostBack="false" EnableDebugMode="false" EnableContextMenu="true" EnableAjaxOnEditDelete="true"
                                                    EditNodeProvider="~/ASTreeViewRenameNodeHandler.aspx" DeleteNodeProvider="~/ASTreeViewDeleteNodeProvider.aspx"
                                                    AddNodeProvider="~/ASTreeViewDemo3.aspx" AdditionalAddRequestParameters="{'t':'ajaxAdd'}"
                                                    AddNodePromptDefaultValue="New Node" AddNodePromptMessage="Hello, please add a new node:"
                                                    AddNodeDataValueProvider="return prompt('new ndoe? under:' + elem.getAttribute('treeNodeValue'),'new node name');"
                                                    OnNodeAddedScript="addedHandler(elem)" OnNodeEditedScript="editedHandler(elem)"
                                                    OnNodeDeletedScript="deletedHandler(val)" />
                                            </fieldset>
                                        </td>
                                    </tr>
                                </table>
                                <div class="clear">
                                </div>
                            </div>
                            <!--  end content-table-inner  -->
                        </td>
                        <td id="tbl-border-right">
                        </td>
                    </tr>
                    <tr>
                        <th class="sized bottomleft">
                        </th>
                        <td id="tbl-border-bottom">
                            &nbsp;
                        </td>
                        <th class="sized bottomright">
                        </th>
                    </tr>
                </table>
                <div class="clear">
                    &nbsp;</div>
            </div>
            <!--  end content -->
            <div class="clear">
                &nbsp;</div>
        </div>
        <!--  end content-outer -->
        <div id="divConsole" runat="server">
        </div>
        <link href="<%= Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview.css"
            type="text/css" rel="stylesheet" />
        <link href="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu.css"
            type="text/css" rel="stylesheet" />

        <script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview_packed.js"
            type="text/javascript"></script>

        <script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu_packed.js"
            type="text/javascript"></script>

        <script type="text/javascript">
            //parameter must be "elem"
            function addedHandler(elem) {
                document.getElementById("<%=divConsole.ClientID %>").innerHTML
			+= (">>edit completed. [Node]" + elem.getAttribute("treeNodeValue")
			+ "<br />");
            }

            //parameter must be "elem"
            function editedHandler(elem) {
                document.getElementById("<%=divConsole.ClientID %>").innerHTML
			+= (">>edit completed. [Node]" + elem.getAttribute("treeNodeValue")
			+ "<br />");
            }

            //parameter must be "val"
            function deletedHandler(val) {
                document.getElementById("<%=divConsole.ClientID %>").innerHTML
			+= (">>delete completed. [Node]" + val
			+ "<br />");
            }
        </script>

    </ContentTemplate>
</asp:UpdatePanel>